---
layout: api
title: "v2.0.1 JavaScript Library: L.mapbox.styleLayer(url, options)"
categories: api
version: v2.0.1
permalink: /api/v2.0.1/l-mapbox-stylelayer/
---
<h2 id="section-l-mapbox-stylelayer">L.mapbox.styleLayer(url, options)</h2>
<p><span class='leaflet icon'><em>Extends</em>: <code><a href="/mapbox.js/api/v2.0.1/l-tilelayer">L.tileLayer</a></code></span></p>
<p><code><a href="/mapbox.js/api/v2.0.1/l-mapbox-stylelayer">L.mapbox.styleLayer</a></code> provides a way to integrate <a href="https://www.mapbox.com/help/define-style/">styles</a> created with Mapbox Studio into your map.</p>
<table>
<thead>
<tr>
<th>Options</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>url</td>
<td>string</td>
<td>Must be a string like <code>mapbox://styles/mapbox/cin286r4x006safncofpcb71v</code></td>
</tr>
<tr>
<td>options</td>
<td>object</td>
<td>If provided, it is the same options as provided to <code><a href="/mapbox.js/api/v2.0.1/l-tilelayer">L.tileLayer</a></code>, as well as: <ul><li><code>sanitizer</code>: A function that accepts a string containing tooltip data, and returns a sanitized result for HTML display. The default will remove dangerous script content, and is recommended.</li></td>
</tr>
</tbody>
</table>
<p><em>Example</em>:</p>
<pre><code>var styleLayer = L.mapbox.styleLayer(url)
    .addTo(map);
</code></pre><p><em>Returns</em> a <code><a href="/mapbox.js/api/v2.0.1/l-mapbox-stylelayer">L.mapbox.styleLayer</a></code> object.</p>
